/******************************************************************************
 * $Id: tags.h,v 1.6 2004/09/22 01:14:28 jimb Exp $
 * @file
 * @author  Jim Brooks http://www.jimbrooks.org
 ******************************************************************************/

#ifndef TAGS_H
#define TAGS_H


void
PrepareProcessCtags( void );

void
ProcessCtagsFromFile( char* pFilename );

char*
ReadCtagsFromFile( guint* pCtagsSize, /* OUT */
                   char*  pFilename );

void
ProcessCtagsFromStdin( void );

GList*
ProcessCtagsBuf( char* pCtags,
                 guint ctagsSize );

FUNC_X
ProcessCtagsLine( const char* pLine,
                  GList**     ppGlist, /*IN/OUT*/
                  tag_t**     ppTag ); /*OUT*/

void
MinimizeTagStruct( tag_t* pTag,
                   GList*      pGlist );

tag_t*
AllocTagStruct( void );

void
FreeTagStruct( tag_t* pTag );

void
FillTagStruct( tag_t*  pTag,
               gchar*  pName,
               gint    lineNum,
               gchar*  pType,
               gchar*  pModuleName );

gboolean
IsTagFabricated( tag_t* pTag );

tag_t*
FabricateFuncCallTag( char* pFuncCallId,
                      int   lenFuncCallId );

const char*
CheckTagType( const char* pTagType );

gboolean
IsFuncLikeTag( tag_t* pTag );

gboolean
IsMacroTag( tag_t* pTag );

tag_t*
FindTag( char* pTagName,
         char* pTagType );

tag_t*
FindFuncTag( char*     pName,
             module_t* pModule );

tag_t*
FindFuncTagAnyOtherModule( char*  pName,
                           GList* pLinkModuleCurrent );

guint
HashFuncTagsKey( gconstpointer pTagName );

gint
HashFuncTagsCmp( gconstpointer pTagName1,
                 gconstpointer pTagName2 );

void
GotoTagUnderCursor( void );

void
GotoTagUnderCursor2( void );

void
ResortTagsGlist( int sort );

gint
ResortTagsGlistCompare( gconstpointer pTag1,
                        gconstpointer pTag2 );

inline gint
CompareTags( const tag_t* pTag1,
             const tag_t* pTag2,
             int          member );

void
WarnTooManyTags( void );

/*============================================================================*/

/*
static char** xpm_data[]=
{
 typedef_obj_xpm,
 types_obj_xpm,
 union_obj_xpm,
 var_declare_obj_xpm,
 var_obj_xpm,
 unknown_obj_xpm,
 enum_obj_xpm,
 class_obj_xpm,
 function_obj_xpm,
 macro_obj_xpm,
 struct_obj_xpm,
 define_obj_xpm,
 include_obj_xpm,
 bin_file_obj_xpm,
 c_file_obj_xpm,
 h_file_obj_xpm,
 folder_obj_xpm,
 file_obj_xpm,
 
 namespace_obj_xpm,
 namespaces_obj_xpm,
 method_public_obj_xpm,
 method_protected_obj_xpm,
 method_private_obj_xpm,
 members_obj_xpm,
 
 make_target_obj_xpm,
 lib_obj_xpm,
};
*/

/*
 * define the xpm format pictures index
 */
enum xpm_type
{
    TYPEDEF_OBJ,
    TYPES_OBJ,
    UNION_OBJ,
    VAR_DECLARE_OBJ,
    VAR_OBJ,
    UNKNOWN_OBJ,
    ENUM_OBJ,
    CLASS_OBJ,
    FUNCTION_OBJ,
    MACRO_OBJ,
    STRUCT_OBJ,
    DEFINE_OBJ,
    INCLUDE_OBJ,
    BIN_FILE_OBJ,
    C_FILE_OBJ,
    H_FILE_OBJ,
    FOLDER_OBJ,
    FILE_OBJ,
    
    NAMESPACE_OBJ,
    NAMESPACES_OBJ,
    METHOD_PUBLIC_OBJ,
    METHOD_PROTECTED_OBJ,
    METHOD_PRIVATE_OBJ,
    MEMBERS_OBJ,
    MAKE_TARGET_OBJ,
    LIB_OBJ,
    
    N_XPM_TYPE      // numbers
};

typedef struct _pair
{
    gpointer data1;
    gpointer data2;
} pair_t;


void
InitPixmaps();

pair_t *
GetPixmapByType( gchar *pType );

pair_t*
GetPixmapByFileName( gchar *pType );


#endif /* TAGS_H */
